#include <iostream>
using namespace std;

double getAverage(int *arr,int size); //声明函数

int main() {
    int arr[5] = {1000,2,3,17,50};
    double avg;

    avg = getAverage(arr,5);

    cout << "Average value is :" << avg << endl;
    return 0;
}

//定义函数
double getAverage(int *arr,int size){
    int i ,sum = 0;
    double avg;
    for (i = 0; i < size; i++){
        sum += arr[i];
    }
    avg = double(sum)/size;
    return avg;
}